package org.zxy.cxf;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

public class MyClient {
	public static void main(String[] args) {
		JaxWsProxyFactoryBean factory =  new JaxWsProxyFactoryBean();
		factory.setAddress("http://localhost:8080/myservice");
		factory.setServiceClass(MyService.class);
		MyService myService = (MyService) factory.create();
		
		//MyService并非服务端的接口，而是通过wsdl生成的MyService代理接口
		System.out.println(myService.getClass()+", "+myService.getClass().getSuperclass());
		
		System.out.println(myService.sayHello("zhangsan", "beijing", "peking university"));
	}
}
